import request from "@/lib/utils/request";
import { PaginationType, Response, ResponseWithPagination } from "../common";
import type { Notice } from "./notice.d";

export const getNoticeListApi = (
  params: PaginationType,
): ResponseWithPagination<Notice> => {
  return request.get("/system/notice/list", { params });
};

export const deleteNoticeApi = (id: string): Response<null> => {
  return request.delete(`/system/notice/${id}`);
};

export const getNoticeApi = (id: string): Response<Notice> => {
  return request.get(`/system/notice/${id}`);
};

export const updateNoticeApi = (data: Notice): Response<null> => {
  return request.put("/system/notice", data);
};

export const addNoticeApi = (data: Notice): Response<null> => {
  return request.post("/system/notice", data);
};
